Title: SQL W3S (By-BKK) / 015 Aggregate
Tags: Obsidian_to_Anki

Q: What is an aggregate function in SQL?
A: A function that performs a calculation on a set of values and returns a single value

Q: Name five commonly used SQL aggregate functions
A: MIN(), MAX(), COUNT(), SUM(), AVG()

Q: Which SQL clause is often used with aggregate functions to split the result set into groups?
A: GROUP BY

Q: What does the SQL MIN() function return?
A: The smallest value in the selected column

Q: What does the SQL MAX() function return?
A: The largest value in the selected column

Q: What does the SQL COUNT() function do?
A: Counts the number of rows in a set

Q: What does the SQL SUM() function do?
A: Adds up all the values in a numerical column

Q: What does the SQL AVG() function do?
A: Calculates the average value of a numerical column

Q: Do SQL aggregate functions ignore null values? (True/False)
A: True (except COUNT(*))

Q: COUNT(*) in SQL ignores null values (True/False)
A: False

Q: Aggregate functions return a single value for each group created by GROUP BY
A: True

Q: MIN() returns the smallest value in a column
A: What does MIN() do in SQL?

Q: MAX() returns the largest value in a column
A: What does MAX() do in SQL?

Q: COUNT() gives the number of rows in a set
A: What does COUNT() do in SQL?

Q: SUM() adds all the values in a numerical column
A: What does SUM() do in SQL?

Q: AVG() finds the average value of a numerical column
A: What does AVG() do in SQL?

Q: Aggregate functions are mostly used with GROUP BY
A: When are aggregate functions mostly used?

Q: Aggregate functions always ignore NULL values except for one function
A: Which aggregate function does NOT ignore NULL values?